﻿@model Orion.Models.RegisterModel

@{
    ViewBag.Title = "IRIS - Innranet - Nýskráning notanda";
    Layout = "~/Views/Shared/_WorkLayout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<section id="main_content_wrapper">
<h1>Búa til nýjan aðgang</h1>
<p>
    Notið þetta útfyllingarform til að búa til nýjan notenda. 
</p>
<p>
    Lykilorð þurfa að vera lágmark @ViewBag.PasswordLength stafa langt.
</p>

@{ Html.EnableClientValidation(); }

@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })){
    @Html.ValidationSummary(true, "Tilraun mistókst, Vinsamlega reynið aftur.")
    <div>
        <fieldset>
            <legend>Aðgangsupplýsingar</legend>

            <div class="editor-label">
                @Html.LabelFor( m => m.UserName, "Notendanafn" )
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName)
                @Html.ValidationMessageFor(m => m.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email, "E-mail")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Password, "Lykilorð")
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password)
                @Html.ValidationMessageFor(m => m.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.ConfirmPassword, "Lykilorð Endurtekið")
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.ConfirmPassword)
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </div>
        
        </fieldset>
        <fieldset>
            <legend>Persónulegar upplýsingar</legend>
              <div class="editor-label">
                @Html.LabelFor(m => m.User.FirstName, "Fornafn")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.FirstName)
                @Html.ValidationMessageFor(m => m.User.FirstName)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.MiddleName, "Millinafn")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.MiddleName)
                @Html.ValidationMessageFor(m => m.User.MiddleName)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.LastName, "Eftirnafn")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.LastName)
                @Html.ValidationMessageFor(m => m.User.LastName)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.SSN, "Kennitala")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.SSN)
                @Html.ValidationMessageFor(m => m.User.SSN)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.HomePhone, "Heimasími")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.HomePhone)
                @Html.ValidationMessageFor(m => m.User.HomePhone)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.WorkPhone, "Vinnusími")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.WorkPhone)
                @Html.ValidationMessageFor(m => m.User.WorkPhone)
            </div>

              <div class="editor-label">
                @Html.LabelFor(m => m.User.MobilePhone, "Farsími")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.MobilePhone)
                @Html.ValidationMessageFor(m => m.User.MobilePhone)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.User.PostCode, "Póstnúmer")
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(model => model.User.PostCode, Orion.Controllers.HomeController.GetAllPostCode())
                @Html.ValidationMessageFor(model => model.User.PostCode)
            </div>

             <div class="editor-label">
                @Html.LabelFor(m => m.User.Address, "Heimilisfang")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.User.Address)
                @Html.ValidationMessageFor(m => m.User.Address)
            </div>


            <div class="editor-label">
                <label for="file">Mynd</label>
             </div>
            <div class="editor-field">
                <input type="file" name="file" id="file" />
             </div>

             <div class="editor-label">
                @Html.LabelFor(m => m.User.Info, "Nánari lýsing")
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.User.Info)
                @Html.ValidationMessageFor(m => m.User.Info)
            </div>
            
            <div class="editor-label">
                <label for"role">Réttindi</label>
            </div>
            <div class="editor-field">
                <select id="role" name="role">
                    <option value="Admin">Stjórnandi</option>
                    <option value="Staff">Starfsmaður</option>
                    <option value="General">Almennur</option>
                </select>
            </div>

            <p>
                <input type="submit" value="Nýskrá" />
            </p>
        </fieldset>
    </div>
}
</section>